#include<bits/stdc++.h>
using namespace std;
int n,ans;
struct node{
    int x,y=1;
}a[100005];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    cin>>a[1].x;
    for(int j=2;j<=n;j++){
        cin>>a[j].x;
        if(a[j].x>a[j-1].x){
            a[j-1].y=0;
            a[j].y=2;
        }
        else if(a[j].x<a[j-1].x&&a[j-1].y==1){
            a[j-1].y=2;
            a[j].y=0;
        }
    }
    for(int i=1;i<=n;i++){
        if(a[i].y)ans++;
    }
    cout<<ans;
    return 0;
}
